/*----------------------------------------------------------------------------
 * osObjects.h: CMSIS-RTOS global object definitions for an application
 *----------------------------------------------------------------------------
 *
 * This header file defines global RTOS objects used throughout a project
 *
 * #define osObjectsPublic indicates that objects are defined; without that
 * definition the objects are defined as external symbols.
 *
 *--------------------------------------------------------------------------*/


#ifndef __osObjects
#define __osObjects

#ifdef osObjectsPublic
#define OBJ_EXT  
#else
#define OBJ_EXT extern 
#endif

#include  <includes.h>            
#include  <gd32f4xx.h>

void  AppTaskCreate (void);
void  AppObjCreate (void);

// global 'thread' functions ---------------------------------------------------
#define  APP_CFG_TASK_BLINKY_STK_SIZE            128
#define  APP_CFG_TASK_BLINKY_PRIO                10
OBJ_EXT  OS_TCB         AppTaskBlinkyTCB;
OBJ_EXT  CPU_STK        AppTaskBlinkyStk[APP_CFG_TASK_START_STK_SIZE];
OBJ_EXT  void           AppTaskBlinky             (void  *p_arg);

#define  TASK_ACCELERATION_STK_SIZE              128
#define  TASK_ACCELERATION_PRIO                  10
OBJ_EXT  OS_TCB         AccelerationTaskTCB;
OBJ_EXT  CPU_STK        AccelerationTaskStk[TASK_ACCELERATION_STK_SIZE];
OBJ_EXT  void           AccelerationTask          (void  *p_arg);


#define  TASK_LEDCTR_STK_SIZE                    128
#define  TASK_LEDCTR_PRIO                        16
OBJ_EXT  OS_TCB         LedCtrTaskTCB;
OBJ_EXT  CPU_STK        LedCtrTaskStk[TASK_LEDCTR_STK_SIZE];
OBJ_EXT  void           LedCtrTask               (void  *p_arg);

#define  TASK_COM_STK_SIZE                       128
#define  TASK_COM_PRIO                           10
OBJ_EXT  OS_TCB         ComTaskTCB;
OBJ_EXT  CPU_STK        ComTaskStk[TASK_COM_STK_SIZE];
OBJ_EXT  void           ComTask                  (void  *p_arg);

/*
#define  TASK_COMTTL_STK_SIZE                    128
#define  TASK_COMTTL_PRIO                        10
OBJ_EXT  OS_TCB         ComTtlTaskTCB;
OBJ_EXT  CPU_STK        ComTtlTaskStk[TASK_COMTTL_STK_SIZE];
OBJ_EXT  void           ComTtlTask               (void  *p_arg);
*/

#define  TASK_WIFI_STK_SIZE                    128
#define  TASK_WIFI_PRIO                        10
OBJ_EXT  OS_TCB         WifiTaskTCB;
OBJ_EXT  CPU_STK        WifiTaskStk[TASK_WIFI_STK_SIZE];
OBJ_EXT  void           WifiTask               (void  *p_arg);

#define  TASK_TEMPCTR_STK_SIZE                   256
#define  TASK_TEMPCTR_PRIO                       12
OBJ_EXT  OS_TCB         TempCtrTaskTCB;
OBJ_EXT  CPU_STK        TempCtrTaskStk[TASK_TEMPCTR_STK_SIZE];
OBJ_EXT  void           TempCtrTask              (void  *p_arg);


#define  TASK_MODBUS_STK_SIZE                    128
#define  TASK_MODBUS_PRIO                        8
OBJ_EXT  OS_TCB         ModbusTaskTCB;
OBJ_EXT  CPU_STK        ModbusTaskStk[TASK_MODBUS_STK_SIZE];
OBJ_EXT  void           ModbusTask               (void  *p_arg);



// global enent-groups object  -------------------------------------------------
OBJ_EXT OS_FLAG_GRP      FlagWifiEvent;
#define VAL_WIFI_FLAG_INIT                     0

#endif  // __osObjects
